namespace game {
    export namespace gameData {

        export class Main extends lib.ObjectValue {
            constructor(init:any = null) {
                super();
                this.className = "Main";
				this.$setMember("game" , lib.DataManager.getInstance().createData("game.gameData.Game",null));
				this.$setMemberSaveClass("game" ,false);
				this.$setMember("event" , lib.DataManager.getInstance().createData("game.gameData.Event",null));
				this.$setMemberSaveClass("event" ,false);
				if(init) this.value = init;
				this.$addPropertyBinding();

            }
            
            private bindings:Array<lib.Binding>;
            $addPropertyBinding() {
                if(super.$addPropertyBinding) {
                    super.$addPropertyBinding();
                } else {
                    if(!this.bindings) this.bindings = [];
                    for(let i = 0; i < this.bindings.length; i++) this.bindings[i].dispose();
                    this.bindings.length = 0;
                }

            }
            
            checkAllBinding() {
            	this.$addPropertyBinding();
            	for(let key in this.__value) {
            		if(this.__value[key] && this.__value[key].checkAllBinding) this.__value[key].checkAllBinding();
				}
			}
        
			get gameValue():lib.Value { return this.__value["game"]; }

			get game():game.gameData.Game {
				return this.__value["game"];
			}

			set game(val:game.gameData.Game) {
				this.setValue("game", val);
			}

			/**
			 * 全局事件
			 * @returns {game.gameData.Event}
			 */
			get eventValue():lib.Value { return this.__value["event"]; }

			/**
			 * 全局事件
			 * @returns {game.gameData.Event}
			 */
			get event():game.gameData.Event {
				return this.__value["event"];
			}

			/**
			 * 全局事件
			 * @param {game.gameData.Event}
			 */
			set event(val:game.gameData.Event) {
				this.setValue("event", val);
			}


        }
        
        lib.DataManager.getInstance().$addClassDefine(Main,"game.gameData.Main");
        
    }
    
    
}


